<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"  %>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="format-detection" content="telephone=no, email=no">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="full-screen" content="yes">
    <meta name="browsermode" content="application">
    <meta name="screen-orientation" content="portrait">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>dld</title>
    <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <style>
    html {
        height: 100%;
    }
    
    body {
        height: 100%;
        background: linear-gradient(rgb(204, 255, 153), rgb(204, 255, 255));
        overflow-x: hidden;
        font-family: SimSun;
        color: rgba(255, 255, 255, 0.8);
    }
    
    /*暗影*/
    
    .box-shadow {
        box-shadow: 0 0 10px 2px rgba(0, 0, 0, 1);
    }

    /*输入表格*/
    input:not(:focus).record-input {
        opacity: 0.4;
    }
    input:focus.record-input{
        -webkit-transform: scale(1.02);
        -moz-transform: scale(1.02);
        transform: scale(1.02);
        opacity: 0.4;
    }
    .control-label {
        padding: 6px 0 0 13px; 
    }
    .col-sm-11.col-xs-10 {
        padding-left: 0 !important;
    }
    .form-control {
        background: #fff;
        color: rgb(0, 0, 0);
        border: 0;
    }
    .list-group-item {
        background: rgba(84, 84, 84, .85);
        padding: 5px;
        color: #000;
        border: 1px solid rgba(255, 255, 255, .15);
    }
    label {
        color: rgba(255, 255, 255, 0.8);
    }
    </style>
</head>

<body>
    <nav class="navbar navbar-top box-shadow" style="background-color: rgb(51, 51, 51);margin-bottom: 0;">
        <div class="col-xs-3" onclick="window.location.href='MsgAction'">
            <span class="glyphicon glyphicon glyphicon-user pull-left" style="font-size: 18px;margin-top: 13px;"></span>
        </div>
        <div class="col-xs-6" align="center">
            <p style=";font-size: 27px;margin: 5px 0 0 0;">dld</p>
        </div>
        <div class="col-xs-3">
            <span class="glyphicon glyphicon-search pull-right" style="font-size: 18px;margin-top: 13px;"></span>
        </div>
    </nav>
    <div class="row-fluid box-shadow" style="background: rgba(51, 51, 51, .85);border-radius:5px;position: absolute;top: 50%;left: 50%;width: 300px;height:300px;margin: -150px 0 0 -150px;">
        <div class="col-xs-12">
            <h1 style="font-weight: bold">登录</h1>
            <span>欢迎来到大乱斗</span>
            <p class="pull-right" style="color:rgb(227,87,88);"><s:property value="error"/></p>
        </div>
        <form action="loginUsersAction" method="POST" id="login">
            <div class="col-xs-12 list-group-item">
                <label class="col-xs-2 control-label" for="username">账号</label>
                <div class="col-xs-10">
                    <input type="text" class="form-control record-input" id="username" name="username">
                    <div class="username-msg" role="alert" style="margin-bottom:0;display:none;color:rgb(227,87,88);"></div>
                </div>
            </div>
            <div class="col-xs-12 list-group-item">
                <label class="col-xs-2 control-label" for="password">密码</label>
                <div class="col-xs-10">
                    <input type="password" class="form-control record-input" id="password" name="password">
                    <div class="password-msg" role="alert" style="margin-bottom:0;display:none;color:rgb(227,87,88);"></div>
                </div>
            </div>
        <div class="btn pull-left col-xs-4" style="margin: 10px;background-color: rgba(84, 84, 84, .65);border: 1px solid rgba(255, 255, 255, .15);" onclick="submit()" class="btn btn-default">登录</div>
        </form>
        <button class="btn pull-right col-xs-4" style="margin: 10px;background-color: rgba(84, 84, 84, .65);border: 1px solid rgba(255, 255, 255, .15);" onclick="window.location.href='/dld/home/users/register.jsp'">注册</button>
        <a href="#" class="pull-right" style="color: rgba(255, 255, 255, 0.8);margin-right: 10px">忘记密码?</a>
    </div>
    <script src="http://cdn.bootcss.com/zepto/1.1.6/zepto.min.js"></script>
    <script>
    function submit(){
        if($('#username').val().length < 3 || $('#username').val().length >= 18){
        	$('.username-msg').show();
        	$('.red-div').height(420);
        	$('.username-msg').text('请输入有效用户名！');
        	return;
        }else{
        	$('.red-div').height(400);
        	$('.username-msg').hide();
        }
        if($('#password').val().length < 3 || $('#password').val().length > 18){
        	$('.password-msg').show();
        	$('.red-div').height(420);
        	$('.password-msg').text('请输入有效密码！');
        	return;
        }else{
        	$('.red-div').height(400);
        	$('.password-msg').hide();
        }
    	$('#login').submit();
    }
    </script>
</body>

</html>
